<template>
  <div class="goods-type">
    <van-sidebar v-model="activeKey">
      <van-sidebar-item v-for="(item,index) in typelist" :key="index" :title="item.type_name" @click="onChange(item.id , index)" />
    </van-sidebar>
  </div>
</template>

<script>
export default {
  name: 'GoodsType',
  props: ['typelist', 'sign'],
  data () {
    return {
      activeKey: 0,
    };
  },
  created () {
    this.activeKey = this.sign
  },
  methods: {
    onChange (tid, index) {
      this.$emit('info', tid, index)
    },
  },
}
</script>

<style lang="less" scoped>
.goods-type {
  position: absolute;
  top: 88px;
  left: 0;
  bottom: 0;
  background-color: #f6f6f6;
  width: 20%;
  /deep/ .van-sidebar {
    width: 2rem;
    margin: 0;
  }
  /deep/ .van-sidebar-item {
    background-color: #f6f6f6;
  }
  /deep/ .van-sidebar-item--select,
  .van-sidebar-item--select:active {
    background-color: #fff;
  }
  /deep/ .van-sidebar-item--select::before {
    background-color: #1bb89c;
  }
  /deep/ .van-sidebar-item__text {
    font-size: 20px;
  }
}
</style>